/*
 *  Created on: May 18, 2009
 *      Author: Ramesh Rajaby
 */

#include "../Shared.h"

namespace SymphonyBC {


int getPrimitiveSupertype(int p1, int p2) {
	if (max(PrimitiveTypes::SIZES[p1], PrimitiveTypes::SIZES[p2]) <= 4) {
		if (p1 == PrimitiveTypes::FLOAT || p2 == PrimitiveTypes::FLOAT)
			return PrimitiveTypes::FLOAT;
		else
			return PrimitiveTypes::INT;
	} else {
		if (p1 == PrimitiveTypes::FLOAT || p2 == PrimitiveTypes::FLOAT ||
			p1 == PrimitiveTypes::DOUBLE || p2 == PrimitiveTypes::DOUBLE)
			return PrimitiveTypes::DOUBLE;
		else
			return PrimitiveTypes::LONG;
	}
}


}
